#include <iostream>
#include <iomanip>
#include <bitset>
#include <sstream>

void print_bin(int num) {
    std::ostringstream ss;
    ss << std::bitset<10>(num);
    std::cout << num << " : " << ss.str() << std::endl;
}

void test(int num) {
    print_bin(num);
    num = num & (num ^ 8);
    print_bin(num);    
}

int main() {
    test(8);
    test(9);
    test(1);
    test(16383);
    
    return 0;
}